package com.xgk.boot.module.core.controller.admin.customer.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import lombok.Data;

/**
 * 客户地址信息实体类
 * 对应数据库表：customer_address
 */
@Schema(description = "新建/更新发货地址 Request VO")
@Data
public class CustomerAddressSaveVO {
    /**
     * 主键ID
     */
    private Long id;

    /**
     * 客户id
     */
    private Long customerId;

    /**
     * 客户code
     */
    private String customerCode;

    /**
     * 名称
     */
    @Schema(description = "发货人姓名", requiredMode = Schema.RequiredMode.REQUIRED, example = "Json Bo")
    @NotBlank(message = "发货人姓名不能为空")
    @Size(max = 100, message = "客户编码不超过  100 个字符")
    private String shipperName;

    /**
     * 地址编码（自定义-不重复）
     */
    @Schema(description = "发货地址编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "JA_001")
    @NotBlank(message = "发货地址编码不能为空")
    @Size(max = 30, message = "发货地址编码不超过 30 个字符")
    @Pattern(regexp = "^[A-Za-z0-9_-]{1,30}$", message = "账号格式为1-30位数字、字母、下划线或连字符")
    private String sn;

    /**
     * 国家--选择
     */
    @Schema(description = "国家", requiredMode = Schema.RequiredMode.REQUIRED, example = "US[美国]")
    @NotBlank(message = "国家不能为空")
    @Size(max = 45, message = "国家不超过 45 个字符")
    private String country;

    /**
     * 邮编
     */
    @Schema(description = "邮编", requiredMode = Schema.RequiredMode.REQUIRED, example = "051267")
    @NotBlank(message = "邮编不能为空")
    @Size(max = 30, message = "邮编不超过 30 个字符")
    private String postcode;

    /**
     * 州/区域
     */
    @Schema(description = "州", requiredMode = Schema.RequiredMode.REQUIRED, example = "LZ")
    @NotBlank(message = "州不能为空")
    @Size(max = 90, message = "州不超过 90 个字符")
    private String state;

    /**
     * 城市
     */
    @Schema(description = "城市", requiredMode = Schema.RequiredMode.REQUIRED, example = "Zion")
    @NotBlank(message = "城市不能为空")
    @Size(max = 90, message = "城市不超过 90 个字符")
    private String city;

    /**
     * 地址1
     */
    @Schema(description = "地址", requiredMode = Schema.RequiredMode.REQUIRED, example = "LZ")
    @NotBlank(message = "地址1不能为空")
    @Size(max = 90, message = "地址1不超过 90 个字符")
    private String streetAddress1;

    /**
     * 地址2
     */
    private String streetAddress2;

    /**
     * 门牌号
     */
    private String doorplate;

    /**
     * 电话
     */
    @Schema(description = "电话", requiredMode = Schema.RequiredMode.REQUIRED, example = "15611109011")
    @NotBlank(message = "电话不能为空")
    @Size(max = 30, message = "电话不超过 30 个字符")
    private String telephone;

    /**
     * 公司
     */
    private String company;
}
